<template>
  <div>
    <div class="jnhfxq_box">
      <div class="jnhfxq_box_title">缴纳会费</div>
      <div class="jnhfxq_nr_box">
        <div class="jnhfxq_nr_box_title">{{ list.mechanism_name }}机构：</div>
        <div class="jnhfxq_nr">
          您好，你单位{{ list.year }}年度会费未缴纳！
          会员专享功能权限到期后将无法继续使用，请及时缴纳{{ list.year }}年度会费！
          请依次点击“核对信息”、”缴纳会费”按钮办理。
<!-- 
          您好，{{ list.year }}年度会费未缴纳!
          <span v-if="list.validity_date">
            相应功能权限将于至{{ list.validity_date }}停用!
          </span>
          <span v-if="!list.validity_date">相应功能权限无法使用</span>
          如需缴纳机构会费，依次点击“核对信息”、”缴纳会费”按钮办理。 -->
        </div>
      </div>
      <div class="button_box_hfxq">
        <el-button type="primary" @click="jump()">核实信息</el-button>
        <el-button class="b_box two_b_box" type="warning" @click="handleClick"
          >缴纳会费</el-button
        >
        <el-button class="b_box" type="primary" @click="back()">返回</el-button>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      id: this.$route.query.id,
      list: {},
      isshow: 0, //0=未核验,1=已核验
    };
  },
  mounted() {
    this.getinfo();
    this.getjump();
  },
  methods: {
    //获取有没有核实信息
    getjump() {
      let that = this;
      let data = {
        id: that.id,
      };
      that.$http.post("mechanism/verification", data).then((res) => {
        if (res.code === 1) {
          that.isshow = res.data.is_verification;
        }
      });
    },
    /**
     * 缴纳会费
     */
    handleClick(e) {
      if (this.isshow == 0) {
        let res = {
          code: 0,
          msg: "请先核实信息！",
        };
        this.$self
          .ts(res, 2)
          .then(() => {
            this.jump();
          })
          .catch((err) => {
            this.jump();
          });
        return;
      }
      this.$router.push({ path: "/hyjnhfxq_2", query: { id: this.id } });
    },
    /**
     * 返回上一级
     */
    back() {
      this.$router.go(-1);
    },
    /**
     * 获取信息
     */
    getinfo() {
      let that = this;
      let data = {
        id: that.id,
      };
      that.$http.post("mechanism/fee_verify", data).then((res) => {
        if (res.code === 1) {
          that.list = res.data;
        }
      });
    },
    /**
     * 核实信息
     */
    jump() {
      let that = this;
      let data = {
        id: that.id,
      };
      that.$http.post("mechanism/save_verification", data).then((res) => {
        if (res.code === 1) {
          this.$router.push({ path: "/hyjbxx" });
        }
      });
    },
    //  ==
  },
};
</script>
<style scoped>
.jnhfxq_box {
  background: #ffffff;
  border-radius: 0.125rem;
  box-shadow: 1px 1px 3px 2px rgba(0, 0, 0, 0.15);
  margin: 0.125rem 0.025rem 0.1rem 0.625rem;
  padding-bottom: 0.4875rem;
}
.jnhfxq_box_title {
  height: 0.9rem;
  text-align: center;
  line-height: 1rem;
  font-size: 0.25rem;
  font-weight: 400;
  color: #333333;
}
.jnhfxq_nr_box {
  width: 14rem;
  border-top: 0.0375rem dotted #dddd;
  margin: auto;
  font-size: 0.225rem;
  font-weight: 400;
  color: #333333;
  line-height: 0.5rem;
  padding-top: 0.675rem;
  display: block;
}
.jnhfxq_nr {
  text-indent: 2em;
}
.button_box_hfxq {
  margin: 1.425rem 0 0 0.5375rem;
}
.button_box_hfxq .b_box {
  margin-left: 0.25rem;
}
</style>
<style>
.two_b_box {
  background-color: #f46d31;
}
</style>